package com.zhkj.shixi.tvplayer.VideoPlayer;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;

import com.zhkj.shixi.tvplayer.R;


/**
 * Created by suqiuyu on 19-8-7.
 */

public class VideoPlayerMenu implements View.OnClickListener {
    private Activity mActivity;
    private ImageButton btnList;
    private ImageButton btnFolder;
    private ImageButton btnSet;
    private ImageButton btnFull;
    private View listView;
    private View menuView;

    private View mListView;

    VideoPlayerMenu(Activity activity) {
        mActivity = activity;
        init();
    }

    private void init() {
        btnList = mActivity.findViewById(R.id.btnList);
        btnFolder = mActivity.findViewById(R.id.btnFolder);
        btnSet = mActivity.findViewById(R.id.btnSet);
        btnFull = mActivity.findViewById(R.id.btnFull);
        listView =mActivity.findViewById(R.id.list_show);
        menuView =mActivity.findViewById(R.id.menu);
        mListView = mActivity.findViewById(R.id.setting);
        btnList.setOnClickListener(this);
        btnFolder.setOnClickListener(this);
        btnSet.setOnClickListener(this);
        btnFull.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {

        switch (v.getId()) {
            case R.id.btnList:
                listView.setVisibility(View.VISIBLE);
                menuView.setVisibility(View.INVISIBLE);

                Toast.makeText(mActivity, "btnList", Toast.LENGTH_SHORT).show();
                break;
            case R.id.btnFolder:
                Toast.makeText(mActivity, "btnFolder", Toast.LENGTH_SHORT).show();
                ComponentName cn = new ComponentName("com.zhkj.shixi.tvfilemanager","com.zhkj.shixi.tvfilemanager.FileManagerAcitivity");
                Intent intent = new Intent();
                intent.setComponent(cn);
                mActivity.startActivity(intent);
                break;
            case R.id.btnSet:
//                setToolListView();
                mListView.setVisibility(View.VISIBLE);
                menuView.setVisibility(View.INVISIBLE);

                break;
            case R.id.btnFull:
                ((VideoPlayerActivity) mActivity).getVideoFull().setVideoFullScreen();
//                Toast.makeText(mActivity, "btnFull", Toast.LENGTH_SHORT).show();
                break;
        }
    }

}
